//
//  ZFTextField.swift
//  map
//
//  Created by fyzq on 2024/1/25.
//

import UIKit

class ZFTextField: UITextField {

    var space:CGFloat = 5;
    var rightSpace:CGFloat = 10
    override func textRect(forBounds bounds: CGRect) -> CGRect {
        let textRect = super.textRect(forBounds: bounds)
        return CGRect(x: textRect.origin.x + space, y: textRect.origin.y, width: textRect.size.width - space , height: textRect.size.height)
    }
    override func editingRect(forBounds bounds: CGRect) -> CGRect {
        let textRect = super.textRect(forBounds: bounds)
        return CGRect(x: textRect.origin.x + space, y: textRect.origin.y, width: textRect.size.width - space , height: textRect.size.height)
    }
    override func rightViewRect(forBounds bounds: CGRect) -> CGRect {
        let textRect = super.rightViewRect(forBounds: bounds)
        return CGRect(x: textRect.origin.x, y: textRect.origin.y, width: textRect.size.width - rightSpace, height: textRect.size.height)
    }
}


